<template>
	<view>
		<u-navbar title-color="#fff" :borderBottom="false" titleColor="#000000" backIconSize="40" back-icon-color="#000000"
		 :background="background"> </u-navbar>
		<view class="top">
			<view class="head">
				<image :src="getHead(info.leader_image)" mode=""></image>
			</view>
			<view class="user">
				<view class="name">
					{{info.leader_username}}
				</view>
			</view>
		</view>
		<view class="div"></view>
		<view class="content">
			<view class="up">
				<view class="left">
					亲友团列表
				</view>
				<view class="right" v-if="length<info.person_number-1">
					已邀请 {{length}}/{{info.person_number-1}}
				</view>
				<view class="right2" v-else>
					已成团
				</view>
			</view>
			<view class="down">
				<view class="list" v-for="(a,b) in info.member_list" :key="b">
					<view class="have">
						<view class="quit" v-if="a.user_status==1" @click="content='是否退出拼团？',show3=true">
							退出拼团
						</view>
						<image :src="getHead(a.head_image)" class="head"></image>
						<view class="name">
							{{a.username}}
							<image :src="img_pre+a.manor_logo" mode=""></image>
						</view>
						<view class="down">
							<image src="../static/g4.png" v-if="false" class="img1"></image>
							<view class="a">
								<view class="view" v-for="(c,d) in a.manorList" :key="d">
									<image :src="c.buy_status==0?'../static/g6.png':'../static/g5.png'" class="v1"></image>
									<image :src="img_pre+c.manor_logo" class="v2"></image>
									<view class="dname">
										{{c.title}}
									</view>
									<view class="text" v-if="c.app_status!=0">
										预
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="list" v-for="(item,index) in (info.person_number-length-1)" :key="index">
					<view class="node">
						<image src="../static/g7.png" class="head"></image>
						<view class="name">
							暂无好友
						</view>
						<view class="icon" @click="toPage('user_list3')">
							<image src="../static/g8.png" mode=""></image>
							邀请入团
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="div2"></view>
		<view class="remind">
			<view class="left">
				<view class="name">
					好友累计消耗
				</view>
				<view class="number" v-if="info.leader_identity==1">
					{{info.team_leader_reward}} Fmb
				</view>
				<view class="number" v-else>
					{{info.team_member_reward}} Fmb
				</view>
			</view>
			<view class="right2" @click="content='是否解散拼团？',show3=true" v-if="info.leader_identity==1">
				<image src="../static/g15.png"></image> 解散拼团
			</view>
			<view class="right" :style="info.leader_identity!=1?'margin-left: auto;':''" @click="show=true">
				去提醒
			</view>
		</view>
		<u-popup background="transparent" borderRadius="10" mode="center" v-model="show2">
			<view class="good">
				<view class="g_top">
					<image src="../static/mtk_bg2.png" class="g2"></image>
				</view>
				<view class="g_title" v-if="info.leader_identity==1">
					拼团达成奖励蜜贝 <text>{{info.team_leader_reward}}</text> 个
				</view>
				<view class="g_title" v-else>
					拼团达成奖励蜜贝 <text>{{info.team_member_reward}}</text> 个
				</view>
				<image src="../static/g13.png" @click="show2=false" class="g_button"></image>
			</view>
		</u-popup>
		<u-popup :closeable="true" borderRadius="10" mode="center" v-model="show">
			<view class="popup">
				<view class="popup_top"></view>
				<view class="_view">
					<view class="title">
						提醒亲友
					</view>
					<view class="cont" style="height: auto;">
						<view class="list" v-for="(item,index) in info.member_list" :key="index">
							<image :src="getHead(item.head_image)" mode=""></image>
							<view class="user">
								<view class="name">
									{{item.username}}
								</view>
								<view class="text">
									{{item.tel}}
								</view>
							</view>
							<view class="icon" v-if="item.tel_status==1" @click="setTel(item.tel)">
								拨打电话
							</view>
							<view class="icon" v-else @click="toast('当前好友不是您邀请入团您不能直接拨打电话')">
								拨打电话
							</view>
						</view>
					</view>
				</view>
				<view class="popup_top"></view>
			</view>
		</u-popup>
		<u-modal @confirm="signOutTeam" v-model="show3" :showTitle="false" :showCancelButton="true" :content="content"></u-modal>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				background: {
					'background': '#FFD023'
				},
				show: false,
				show2: false,
				show3: false,
				info: {},
				content: "",
				length: 0
			}
		},
		onLoad(option) {
			than = this;
			than.post('api/Groupwork_novice/membersList', null, function(data) {
				if (data.reward_status > 1) {
					than.show2 = true;
				}
				than.length = data.member_list.length
				than.info = data;
			})
		},
		methods: {
			setTel(tel) {
				uni.makePhoneCall({
					phoneNumber: tel
				});
			},
			signOutTeam() {
				than.post("api/Groupwork_novice/signOutTeam", null, function(data) {
					uni.navigateBack();
				})
			}
		}
	}
</script>

<style lang="less">
	.div2 {
		height: 170rpx;
	}

	.good {
		text-align: center;

		.g_title {
			font-size: 55rpx;
			font-family: PangMenZhengDao;
			font-weight: 400;
			color: #FDFEFD;
			line-height: 100rpx;
			-webkit-text-stroke: 3rpx #FFB165;
			text-stroke: 3rpx #FFB165;

		}

		.g_button {
			width: 200rpx;
			height: 85rpx;
		}

		.g_top {
			text-align: center;
			width: 750rpx;
			height: 654rpx;
			background-image: url(../../../static/image/g13.png);
			background-size: 100% 100%;

			.g2 {
				margin-top: 200rpx;
				width: 144rpx;
				height: 147rpx;
			}

		}
	}

	.top {
		/* #ifdef APP-PLUS */
		padding-top: calc(50rpx + var(--status-bar-height));
		/* #endif */
		/* #ifdef H5 */
		padding-top: 0rpx;
		/* #endif */
		background: #FFD023;
		display: flex;
		align-items: center;

		.head {
			margin-left: 33rpx;
			width: 170rpx;
			height: 160rpx;
			background-image: url(../static/g2.png);
			background-size: 100% 100%;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				margin-top: -15rpx;
				margin-left: -5rpx;
				width: 104rpx;
				height: 103rpx;
				border-radius: 50%;
			}
		}

		.user {
			margin-left: 27rpx;

			.name {
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.text {
				margin-top: 15rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				padding: 0 20rpx;
				height: 44rpx;
				background: #EEC338;
				border-radius: 22rpx;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #805100;
			}
		}

		.icon {
			margin-left: auto;
			width: 160rpx;
			height: 64rpx;
			background: linear-gradient(180deg, #403D39, #5D5C5A);
			border-radius: 32rpx 0 0 32rpx;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				width: 52rpx;
				height: 43rpx;
			}

			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFD023;
		}

	}

	.div {
		background: #FFD023;
		height: 100rpx;
	}

	.content {
		margin-top: -50rpx;
		background: #FFFFFF;
		border-radius: 70rpx 0px 0px 0px;

		.up {
			display: flex;
			height: 90rpx;
			align-items: center;
			padding: 0 37rpx;

			.left {

				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.right {
				margin-left: auto;
				display: flex;
				align-items: center;
				justify-content: center;
				width: 150rpx;
				height: 45rpx;
				background: #FDF2E8;
				border-radius: 10rpx;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #FF5B00;
			}

			.right2 {
				margin-left: auto;
				width: 110rpx;
				height: 45rpx;
				background: linear-gradient(90deg, #FFA800, #FF2C01);
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #FFFFFF;
			}
		}

		.down {
			width: 100%;
			overflow: hidden;

			.list {
				float: left;
				margin-left: 30rpx;
				margin-bottom: 20rpx;
				width: 327rpx;
				height: 480rpx;
				background: #FAFAFA;
				border-radius: 20rpx;
				text-align: center;

				.head {
					margin-top: 24rpx;
					width: 128rpx;
					height: 128rpx;
					border-radius: 50%;
				}

				.have {
					position: relative;

					.quit {
						position: absolute;
						top: 0;
						right: 0;
						display: flex;
						align-items: center;
						justify-content: center;
						font-size: 22rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						width: 109rpx;
						height: 45rpx;
						background: linear-gradient(90deg, #FFA800, #F46813);
						border-radius: 0px 20rpx 0px 20rpx;
					}

					.name {
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
						display: flex;
						align-items: center;
						justify-content: center;

						image {
							width: 36rpx;
							height: 40rpx;
						}
					}

					.down {
						position: relative;
						height: 280rpx;

						.img1 {
							position: absolute;
							width: 2rpx;
							height: 209rpx;
							left: 45rpx;
							top: 20rpx;
							z-index: 1;
						}

						.a {
							position: absolute;
							z-index: 2;
							left: 30rpx;

							.view {
								display: flex;
								align-items: center;
								height: 65rpx;

								.v1 {
									margin-right: 29rpx;
									width: 31rpx;
									height: 31rpx;
								}

								.v2 {
									margin-right: 15rpx;
									width: 36rpx;
									height: 41rpx;
								}

								.n {
									color: #B6B6C5 !important;
								}

								.dname {
									margin-right: 15rpx;
									font-size: 28rpx;
									font-family: PingFang SC;
									font-weight: bold;
									color: #616170;
								}

								.text {
									width: 44rpx;
									height: 29rpx;
									background: #FDE8EA;
									border-radius: 9rpx;
									font-size: 24rpx;
									font-family: PingFang SC;
									font-weight: 500;
									color: #FF4C15;
									display: flex;
									align-items: center;
									justify-content: center;
								}
							}

						}

					}
				}

				.node {
					.name {
						font-size: 32rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #333333;
						height: 110rpx;
						display: flex;
						align-items: center;
						justify-content: center;
					}

					.icon {
						width: 194rpx;
						height: 64rpx;
						background: #FED000;
						border-radius: 32rpx;
						margin: 40rpx auto 0;

						image {
							width: 28rpx;
							height: 28rpx;
							margin-right: 15rpx;
						}

						display: flex;
						align-items: center;
						justify-content: center;
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #7F5600;
					}
				}
			}
		}
	}

	.remind {
		position: fixed;
		left: 0;
		right: 0;
		z-index: 10;
		margin: auto;
		bottom: 18rpx;
		width: 678rpx;
		height: 113rpx;
		background: #FDF2E8;
		border-radius: 57rpx;
		display: flex;
		align-items: center;

		.left {
			margin-left: 74rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #333333;

			.name {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.number {

				font-size: 36rpx;
				font-family: DIN;
				font-weight: bold;
				color: #FF5B00;
			}
		}

		.right2 {
			margin-left: auto;
			margin-right: 13rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 193rpx;
			height: 64rpx;
			background: #FFD023;
			border-radius: 32rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;

			image {
				width: 31rpx;
				height: 32rpx;
				margin-right: 12rpx;
			}
		}

		.right {
			margin-right: 24rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 193rpx;
			height: 64rpx;
			background: #FF5B00;
			border-radius: 32rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
		}
	}

	.popup {
		width: 535rpx;
		background: linear-gradient(0deg, #fcfdff, #e3ebfe);

		.popup_top {
			height: 30rpx;
		}

		._view {
			background: #FFFFFF;
			margin: 0 30rpx 30rpx;

			.title {
				padding-top: 20rpx;
				height: 80rpx;
				line-height: 80rpx;
				text-align: center;
				font-size: 38rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}

			.code {
				text-align: center;
				padding-bottom: 40rpx;

				image {
					width: 81rpx;
					height: 81rpx;
				}
			}

			.cont {
				.list {
					display: flex;
					align-items: center;
					height: 150rpx;
					padding: 0 18rpx;

					image {
						width: 86rpx;
						height: 86rpx;
					}

					.user {
						margin-left: 12rpx;

						.name {
							font-size: 30rpx;
							font-family: PingFang SC;
							font-weight: bold;
							color: #333333;
						}

						.text {
							font-size: 24rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #7E828E;
						}
					}

					.icon {
						margin-left: auto;
						width: 130rpx;
						height: 60rpx;
						background: linear-gradient(90deg, #FFA800, #F46813);
						border-radius: 30rpx;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						display: flex;
						align-items: center;
						justify-content: center;
					}
				}
			}
		}

	}
</style>
